package com.mrjy.integral.controller;

import javax.annotation.Resource;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import com.mrjy.common.entity.SignInInfo;
import com.mrjy.integral.bo.ISignInInfoBo;

@Controller
@RequestMapping("integral/signInInfo")
public class SignInInfoController{
	@Resource
	private ISignInInfoBo signInInfoBo;
	
	/**
	 * 添加
	 * @return
	 */
	@RequestMapping("/add")
	@ResponseBody
	public Object add(SignInInfo info){
		return signInInfoBo.txInsert(info);
	}
	/**
	 * 根据ID查询
	 * @return
	 */
	@RequestMapping("/queryById")	
	@ResponseBody
	public Object queryById(int schoolId) {
		return signInInfoBo.queryById(schoolId);
	}
	/**
	 * 修改
	 * @param userInfo
	 * @return
	 */
	@RequestMapping("/edit")
	@ResponseBody
	public Object edit(SignInInfo info) {		
		return signInInfoBo.txUpdateById(info);
	}
	
	/**
	 * 删除
	 * @param ids
	 * @return
	 */
	@RequestMapping("/deleteByIds")
	@ResponseBody
	public Object deleteByIds(int[] ids) {		
		return signInInfoBo.deleteByIds(ids);
	}
	/**
	 * 禁用、起用
	 * @param ids
	 * @return
	 */
	@RequestMapping("/updateDisableFlag")
	@ResponseBody
	public Object updateDisableFlag(SignInInfo info) {		
		return signInInfoBo.updateDisableFlag(info);
	}
	
	/**
	 * 签到方法
	 * @param 
	 * @return
	 */
	@RequestMapping("/signIn")
	@ResponseBody
	public Object signIn(SignInInfo info) {		
		return signInInfoBo.signIn(info);
	}

    /**
     * 根据UserId查询
     *
     * @return
     */
    @RequestMapping("/queryByUserId")
    @ResponseBody
    public Object queryByUserId(int userId) {
        return signInInfoBo.queryByUserId(userId);
    }


    /**
     * 根据UserId查询
     *
     * @return
     */
    @RequestMapping("/updateByUserId")
    @ResponseBody
    public Object updateByUserId(SignInInfo signInInfo) {
        return signInInfoBo.updateByUserId(signInInfo);
    }


}
